﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Configuration;

namespace CLFramework.MSSqlExport
{
    public class PublishingConfiguration
    {
        List<ScriptConfig> scriptConfigs = new List<ScriptConfig>();

        public static PublishingConfiguration GetConfig()
        {
            return (PublishingConfiguration)ConfigurationManager.GetSection("publishing");
        }

        /// <summary>
        /// 生成脚本配置
        /// </summary>
        public List<ScriptConfig> ScriptConfigs
        {
            get {
                return scriptConfigs;
            }
        }

        public void LoadValuesFromConfigurationXml(XmlNode node)
        {
            foreach (XmlNode n in node.SelectNodes("scripts/script"))
            {
                ScriptConfig config = new ScriptConfig(n);
                scriptConfigs.Add(config);
            }
        }
    }

}
